package top.chj.day18.genericity.上下限;

/**
 * @Auther:小陈的Java
 * 上限
 */
public class Demo1<T extends Number> {
    private int id;
    private T t;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public T getT() {
        return t;
    }

    public void setT(T t) {
        this.t = t;
    }

    public static void main(String[] args) {
        Demo1<Integer> demo1 = new Demo1<>();
        demo1.setT(9);
        System.out.println(demo1.getT());
        //Demo1<String> demo2 = new Demo1<String>();//报错
    }
}

